package com.wanxi.mapper;

import com.wanxi.dto.OrderDTO;
import com.wanxi.dto.OrderDetailsDTO;
import com.wanxi.entity.Order;
import com.wanxi.entity.OrderDetails;
import com.wanxi.query.OrderDetailsQuery;
import com.wanxi.query.OrderQuery;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface OrderMapper {
    Integer addOrder(OrderDTO orderDTO);

    Integer deleteOrder(OrderDTO orderDTO);

    Integer updateOrder(OrderDTO orderDTO);

    List<Order> findOrder(OrderQuery orderQuery);

    Integer addOrderDetails(OrderDetailsDTO orderDetailsDTO);

    Integer deleteOrderDetails(OrderDetailsDTO orderDetailsDTO);

    Integer updateOrderDetails(OrderDetailsDTO orderDetailsDTO);

    List<OrderDetails> findOrderDetails(OrderDetailsQuery orderDetailsQuery);

    Integer updateOrderState(@Param("orderNumber") String orderNumber, @Param("orderState") Integer orderState, @Param("updateTime") String updateTime);

    Integer updateOrderDetailsState(@Param("orderNumber") String orderNumber, @Param("orderState") Integer orderState, @Param("updateTime") String updateTime);
}
